const fs = require("fs");

//读数据库
const userString = fs.readFileSync('./db/users.json').toString();
const userArray  = JSON.parse(userString);
// console.log(userArray)


//写数据库
const user = {"id":5,"name":"sss","password":123546};
userArray.push(user);
const string = JSON.stringify(userArray);
fs.writeFileSync("./db/users.json",string);